package com.wpp.test;

public  class Producer extends Thread{

    private Clerk clerk;

    public Producer(Clerk clerk){

        this.clerk=clerk;
    }
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+"==================开始生产产品========================");
        while (true){

            try {
                sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            clerk.produceProduct();
        }
    }
}

